Generic validation in an XPath-Haskell data binding

نویسندگان

  • Rui Guerra
  • Johan Jeuring
  • S. Doaitse Swierstra
چکیده

An XPath data binding for a given host language provides a translation of XPath expressions to expressions in the host language. This paper discusses an XPathHaskell data binding. XPath validation ensures that a path addresses a possibly nonempty set of nodes in XML documents described by an XML Schema. We present a generic function (defined by induction on the type structure) that validates XPath expressions with respect to an XML Schema. We use Generic Haskell, an extension of Haskell that supports the construction of generic programs. Furthermore we present generic programs that use a valid XPath expression to query and update documents in a typed way. For some XPath expressions, the information present in a given schema is used to avoid visiting parts of a document whose type ensures that no matches or updates will occur.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Customizing an XML-Haskell data binding with type isomorphism inference in Generic Haskell

This paper introduces a type-preserving XML Schema–Haskell data binding (or, translation) UUXML, and shows how to customize it by exploiting the theory of canonical isomorphisms to automatically infer coercions between the machine-generated types and an equivalent, more natural, user-defined set of types. We show how to implement the inference mechanism in Generic Haskell.

متن کامل

UUXML: A Type-Preserving XML Schema-Haskell Data Binding

An XML data binding is a translation of XML documents into values of some programming language. This paper discusses a typepreserving XML–Haskell data binding that handles documents typed by the W3C XML Schema standard. Our translation is based on a formal semantics of Schema, and has been proved sound with respect to the semantics. We also show a program in Generic Haskell that constructs pars...

متن کامل

Type isomorphisms simplify XML programming

A program that processes XML documents can be implemented using an XML data binding. Programming with an XML data binding can be painful, because the classes or types generated by the data binding are not in the style native to the host language. JAXB, a Java-XML data binding, supports binding customizations to mitigate this problem. Programming with a type-safe binding such as our HaskellXML d...

متن کامل

Scripting XML with Generic Haskell

A generic program is written once and works on values of many data types. Generic Haskell is a recent extension of the functional programming language Haskell that supports generic programming. This paper discusses how Generic Haskell can be used to implement XML tools whose behaviour depends on the DTD or Schema of the input XML document. Example tools include XML editors, databases, and compr...

متن کامل

Scrap your Nameplate

Recent research has shown how boilerplate code, or repetitive code for traversing datatypes, can be eliminated using generic programming techniques already available within some implementations of Haskell. One particularly intractable kind of boilerplate is nameplate, or code having to do with names, name-binding, and fresh name generation. One reason for the difficulty is that operations on da...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004